package com.hx.haowumall.haowumallauthserver;

import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;

/**
 * *
 * ＊核心原理
 * * 1)、@EnableRedisHttpSession导入RedisHttpSessionConfiguration配置
 * 1、给容器中添加了一个组件
 * SessionRepository=>>>【RedisOperationsSessionRepository】 ==> redis*Fsession。 sessionB'2、SessionRepositoryFilter == >Filter: session
 * 1、创建的时候，就自动从容器中获取到了SessionRepository;
 * 3、以后获取session。request.getSession();2、原始的request,response都被包装。SessionRepositoryRequestWrapper, SessionRepositoryResponseW
 * //SessionRepositoryRequestWrapper
 * 4、wrappedRequest.getSession();===> SessionRepository ※.
 * 装饰者模式；
 * 自动延期：redis中的数据也是有延期的
 *
 *
 * */


@EnableRedisHttpSession //整合redis作为session存储
@EnableFeignClients
@EnableDiscoveryClient
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class, DruidDataSourceAutoConfigure.class})
public class HaowumallAuthServerApplication {

    public static void main(String[] args) {
        SpringApplication.run(HaowumallAuthServerApplication.class, args);
    }

}
